<!DOCTYPE html>
<?php
	session_start();
?>
<html>
	<head>
		<meta charset="utf-8"/>
		<script language=JavaScript>
			var brzinakucanja = 200;
			var pauzapor = 2000;
			var vremeid = null;
			var kretanje = false;
			var poruka = new Array();
			var slporuka = 0;
			var bezporuke = 0;
			poruka[0] ="Nhà trẻ Ngôi Sao"
			function prikaz() {
			   var text = poruka[slporuka];
			   if (bezporuke < text.length) {
			      if (text.charAt(bezporuke) == " ")
			               bezporuke++
			           var ttporuka = text.substring(0, bezporuke + 1);
			           document.title = ttporuka;
			           bezporuke++
			           vremeid = setTimeout("prikaz()", brzinakucanja);
			            kretanje = true;
			   } else {
			      bezporuke = 0;
			      slporuka++
			      if (slporuka == poruka.length)
			         slporuka = 0;
			      vremeid = setTimeout("prikaz()", pauzapor);
			      kretanje = true;
			   }
			}
			function stop() {
			   if (kretanje)
			      clearTimeout(vremeid);
			   kretanje = false
			}
			function start() {
			   stop();
			   prikaz();
			}
			start();
		</script>
        <link href="images/icon.ico" type="image/vnd.microsoft.icon" rel="icon">
        <link rel="stylesheet" href="css/default.css" type="text/css" />
        <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>
        <script language="javascript" type="text/javascript" src="js/jquery.easing.1.3.js"></script>
        <link rel='stylesheet' href='css/sweet-alert.css'>
		<script src='js/sweet-alert.min.js'></script>
</head>
<body>
	<?php
		if (isset($_REQUEST['session']))
			$_SESSION['taikhoan'] = $_REQUEST['session'];
    	if (!isset($_SESSION['taikhoan']))
			header("Location: ../index.php");
	?>
	<?php require('connect.php'); ?>
    <div id="header"><!---------------------bat dau header------------------------->
    	<?php include('header.php'); ?>
    </div>
	<div id="page">
		<div id="content">
			<!---------------------menu trai + noi dung------------------------->
			<div id="trai">
			<!---------------------menu trai------------------------->
				<div id="menu_trai">
					<?php include('menu_trai.php'); ?>
			    </div>
            </div>
			<!---------------------noi dung------------------------->
			<div id="noi_dung">
				<?php switch(@$_REQUEST['subid'])
					{
					case "them_tre";
						include('themtre.php'); break;
					case "ds_tre";
						include('dstre.php'); break;
					case "them_gv";
						include('themgv.php'); break;
					case "ds_gv";
						include('dsgv.php');break;
					case "them_ph";
						include('themph.php');break;
					case "ds_ph";
						include('dsph.php');break;
					case "hop_dong";
						include('hopdong.php');break;
					case "them_lop":	
						include('themlop.php'); break;
					case "ds_lop":	
						include('ds_lop.php'); break;
					case "nhap_tb":	
						include('nhaptb.php'); break;
					case "ds_tb":	
						include('dstb.php'); break;
					case "nhap_tp":	
						include('nhaptp.php'); break;
					case "ds_tp":	
						include('dstp.php'); break;	
					case "them":	
						include('them.php'); break;	
					case "danhsach":	
						include('danhsach.php'); break;	
					default: 
						include('noi_dung.php');
					}
				?>
			</div>
			<!---kt noi dung---------->
		</div>       
		<!---------------------ket thuc content------------------------->
	</div>
    <div id="footer">
		<?php include('footer.php'); ?>
	</div>
<?php $mysqli->close(); ?>
<?php
	if (isset($_REQUEST['id'])) {
		$id = $_REQUEST['id'];
		echo "<script type='text/javascript'>
				$(function({$id}){
			    	$('#{$id}').addClass('active1');
				});
			</script>";
	}
	if (isset($_REQUEST['subid'])) {
		$subid = $_REQUEST['subid'];
		echo "<script type='text/javascript'>
				$(function({$subid}){
			    	$('#{$subid}').addClass('active2');
				});
			</script>";
	}
?>

</body>
</html>